﻿@using thousandClear.Areas.Admin.Models;
@model GoodModel
@{
    ViewBag.Title = "修改服务";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}

<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>
    <div class="am-tabs am-margin" data-am-tabs>
        <div class="am-tabs-bd">
            <form action="" onsubmit="return check()" method="post" class="am-form" id="form">
                <fieldset>
                    <div class="am-form-group">
                        <label for="ogsDesc">服务名称：</label>
                        <input type="text" id="ogsDesc" placeholder="请服务名称(必填)如：包月" required v-model="ogsDesc" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSalePrice">销售价：</label>
                        <input type="number" id="ogsSalePrice" placeholder="请输入销售价(必填)" required v-model="ogsSalePrice" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsMarketPrice">市场价：</label>
                        <input type="number" id="ogsMarketPrice" placeholder="请输入市场价(非必填)" v-model="ogsMarketPrice" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsArea">面积：</label>
                        <input type="text" id="ogsArea" placeholder="请输入面积如：0-200(非必填)" v-model="ogsArea" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsType">服务类型：</label>

                        <select id="ogsType" v-model="ogsType" v-on:change="changeType()">
                            <option value="1">单次服务</option>
                            <option value="6">包月</option>
                            <option value="2">包季度</option>
                            <option value="3">包半年</option>
                            <option value="4">包年</option>
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSignTime">服务时长/月：</label>
                        <input type="number" id="ogsSignTime" placeholder="请输入服务时长/月(必填)" required v-model="ogsSignTime" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsTime">服务次数：</label>
                        <input type="number" id="ogsTime" placeholder="请输入服务次数(必填)" required v-model="ogsTime" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSeqNum">赠送次数：</label>
                        <input type="number" id="ogsSeqNum" placeholder="请输入赠送次数(非必填)" v-model="ogsSeqNum" />
                    </div>
                    <input type="hidden" name="data" v-bind:value="data" />
                    <button type="submit" class="am-btn am-btn-secondary">提交</button>
                </fieldset>
            </form>
        </div>
    </div>
</div>
@section Scripts{
    <script src="~/Statics/Venders/uedit-1.4.3.1/ueditor.config.js"></script>
    <script src="~/Statics/Venders/uedit-1.4.3.1/ueditor.all.min.js"></script>
    <script>
        var model = new Vue({
            el: '#app',
            data: {
                OGSID:@Model.OGSID,
                ogsDesc: '@Model.ogsDesc',
                ogsSalePrice: '@Model.ogsSalePrice',
                ogsMarketPrice: '@Model.ogsMarketPrice',
                ogsType: @Model.ogsType,
                ogsSignTime: '@Model.ogsSignTime',
                ogsTime: '@Model.ogsTime',
                ogsSeqNum: '@Model.ogsSeqNum',
                ogsArea:'@Model.ogsArea'
            },
            computed: {
                data: function () {
                    return JSON.stringify(this._data);
                }
            },
            methods: {
                changeType:function(){
                    var self=this;
                    if(self.ogsType==1){
                        self.ogsTime=1;
                        self.ogsSignTime=0;
                        self.ogsSeqNum=0                  
                    }                
                }
            }

        })
        $('.admin-sidebar-Good').addClass('current');
    </script>
}
